package com.luck.model.pojo;

import java.util.List;

/**
 * Created by Hua wb on 2018/12/26.
 */
public class PageResponse<T> {
    /**
     * 页码
     */
    private int index;
    /**
     * 总页码
     */
    private int pageCount;
    /**
     * 集合
     */
    private List<T> list;

    public PageResponse(int index, int pageCount, List<T> list) {
        this.index = index;
        this.pageCount = pageCount;
        this.list = list;
    }
    public PageResponse(int index, int total, int limit, List<T> list) {
        this.index = index;
        this.pageCount = total%limit==0 ? total/limit : total/limit+1;
        this.list = list;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getTotal() {
        return pageCount;
    }

    public void setTotal(int total) {
        this.pageCount = total;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }
}
